package com.tidc.match.rabbit.service;

import com.tidc.match.rabbit.dto.ParamReq;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;


@Service
public class PomitFanoutMessageService {
	@Value("${rabbit.fanout.exchange}")
	private String rabbitFanoutExchange;
	@Autowired
	AmqpTemplate amqpTemplate;

	public void sendMessage(ParamReq paramReq) {
//		这里的null是路由键
		amqpTemplate.convertAndSend(rabbitFanoutExchange, null, paramReq);
	}
}
